﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BookInfo.aspx.cs" Inherits="BookInfo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="../../layui/css/layui.css" rel="stylesheet" />
</head>
<body>
     <blockquote class="layui-elem-quote news_search">
        <div class="layui-inline">
            <button class="layui-btn site-demo-active" data-type="tabAdd" id="AddBook">添加图书信息</button>
        </div>
    </blockquote>
    <table class="layui-table" lay-data="{ url:'../API/BooksListHandler.ashx',loading:true, page:true, id:'bookList'}" lay-filter="bookbar" width="100%">
        <thead>
            <tr>
                <th lay-data="{field:'BookID', sort: true}">图书编号</th>
                <th lay-data="{field:'BookName', sort: true , edit: 'text'}">图书名称</th>
                <th lay-data="{field:'Author', sort: true , edit: 'text'}">作者</th>
                <th lay-data="{field:'Publishing', sort: true , edit: 'text'}">出版社</th>
                <th lay-data="{field:'Num', sort: true ,templet: '#num'}">数量</th>
                <th lay-data="{field:'Price', sort: true, edit: 'text'}">图书单价</th>
                <th lay-data="{field:'BookType', sort: true, edit: 'text'}">图书类别</th>
                <th lay-data="{field:'StockTime', sort: true , edit: 'text'}">入库时间</th>
                <th lay-data="{field:'Remake', sort: true , edit: 'text'}">简短介绍</th>
                <th lay-data="{fixed: 'right', align:'center', toolbar: '#bookListbar'}">操作按钮</th>
            </tr>
        </thead>
    </table>
    <script type="text/html" id="bookListbar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详细</a>
    </script>
    <script type="text/html" id="num">
      {{#  if(d.Num <=  5){ }}
        <span style="color: red;">{{ d.Num }}</span>
      {{#  } else { }}
        {{ d.Num }}
      {{#  } }}
    </script>
</body>
</html>
<script src="../../layui/layui.js"></script>
<script src="../../js/Info.js"></script>